package com.guigu.guliproduct.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.guigu.gulicommon.entity.pojo.res.Res;
import com.guigu.guliproduct.entity.SkuSaleAttrValue;
import com.guigu.guliproduct.mapper.SkuSaleAttrValueMapper;
import com.guigu.guliproduct.service.ISkuSaleAttrValueService;
import org.springframework.stereotype.Service;

import java.util.List;

import static com.guigu.gulicommon.constant.enumes.res.SelectResCode.SELECT_ATTRS_LIST;

/**
 * <p>
 * sku销售属性&值 服务实现类
 * </p>
 *
 * @author 陈俊杰
 * @since 2024-07-13
 */
@Service
public class SkuSaleAttrValueServiceImpl extends ServiceImpl<SkuSaleAttrValueMapper, SkuSaleAttrValue> implements ISkuSaleAttrValueService {
    /**
     * 根据SkuId获取销售属性组合
     *
     * @param skuId skuId
     * @return spu销售属性组合
     */
    @Override
    public Res<String> getAttrsListBySkuId(Long skuId) {
        List<String> attrsList = baseMapper.getAttrsListBySkuId(skuId);
        return new Res<>(SELECT_ATTRS_LIST, attrsList);
    }
}
